﻿using BootstrapBlazor.Components;
using OnWork.DataCenter.DAL.DataCenter;
using System.ComponentModel;

namespace OnWork.DataCenter.Shared.Pages.DataSource
{
    /// <summary>
    /// 任务配置
    /// </summary>
    public class TaskConfigVO
    {
        /// <summary>
        /// 主键
        /// </summary>
        [AutoGenerateColumn(Visible = false, Readonly = true)]
        public long ID { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        [AutoGenerateColumn(Text = "任务名称", Searchable = true, Filterable = true, Sortable = true), DisplayName("任务名称")]
        public string Name { get; set; }

        /// <summary>
        /// 是否启用 默认不启用
        /// </summary>
        [AutoGenerateColumn(Text = "是否启用", Sortable = true), DisplayName("是否启用")]
        public bool Enable { get; set; } = false;

        /// <summary>
        /// 任务类型 默认流程处理
        /// </summary>
        [AutoGenerateColumn(Text = "任务类型", Searchable = false, Filterable = false, Sortable = true), DisplayName("任务类型")]
        public DSTaskType Type { get; set; } = DSTaskType.Process;

        /// <summary>
        ///任务配置(显示)
        /// </summary>
        [AutoGenerateColumn(Text = "任务配置", ShowTips = true, TextEllipsis = true, Width = 260), DisplayName("任务配置")]
        public string TaskConfigView { get; set; }

        /// <summary>
        /// 时间周期类型
        /// </summary>
        [AutoGenerateColumn(Text = "周期类型"), DisplayName("周期类型")]
        public DSTaskTimeType PeriodType { get; set; } = DSTaskTimeType.PeriodSeconds;

        /// <summary>
        /// 周期配置
        /// </summary>
        [AutoGenerateColumn(Text = "周期配置"), DisplayName("周期配置")]
        public string PeriodConfig { get; set; }

        /// <summary>
        /// 流程图配置
        /// </summary>
        [AutoGenerateColumn(Visible = false, Readonly = true, Ignore = true)]
        public string DiagramData { get; set; }
    }
}